/*
 * 
 * v1.2 by tonydon
 */
package cn.txdnet.txcms.domain;

import cn.txdnet.txweb.annotation.validation.Default;
import cn.txdnet.txweb.annotation.validation.NotEmpty;
import cn.txdnet.txweb.annotation.validation.Size;
import cn.txdnet.txweb.annotation.validation.Validator;

/**
 *
 * @author txdnet
 */

public class Tagslib  extends BaseEntity{
    private static final long serialVersionUID = -1176002089527757222L;

    private Integer tagid;

    @NotEmpty
    @Size(min=1,max=32)
    private String tagname;
    
    @Default
    private Integer cid;
    
    @Default("-")
    private String ctp;
    
    @Default
    private Byte channeltype;
    
    @Default
    private Byte pubstate;

    public Tagslib() {
    }

    public Integer getTagid() {
        return tagid;
    }

    public void setTagid(Integer tagid) {
        this.tagid = tagid;
    }

    public String getTagname() {
        return tagname;
    }

    public void setTagname(String tagname) {
        this.tagname = tagname;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + (this.tagid != null ? this.tagid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Tagslib other = (Tagslib) obj;
        if (this.tagid != other.tagid && (this.tagid == null || !this.tagid.equals(other.tagid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Tagslib{" + "tagid=" + tagid + ", tagname=" + tagname + ", cid=" + cid + ", ctp=" + ctp + ", channeltype=" + channeltype + ", pubstate=" + pubstate + '}';
    }
    
    
    @Override
    public boolean validate() {
       return Validator.validate(this);
    }

    /**
     * @return the cid
     */
    public Integer getCid() {
        return cid;
    }

    /**
     * @param cid the cid to set
     */
    public void setCid(Integer cid) {
        this.cid = cid;
    }

    /**
     * @return the ctp
     */
    public String getCtp() {
        return ctp;
    }

    /**
     * @param ctp the ctp to set
     */
    public void setCtp(String ctp) {
        this.ctp = ctp;
    }

    /**
     * @return the channeltype
     */
    public Byte getChanneltype() {
        return channeltype;
    }

    /**
     * @param channeltype the channeltype to set
     */
    public void setChanneltype(Byte channeltype) {
        this.channeltype = channeltype;
    }

    /**
     * @return the pubstate
     */
    public Byte getPubstate() {
        return pubstate;
    }

    /**
     * @param pubstate the pubstate to set
     */
    public void setPubstate(Byte pubstate) {
        this.pubstate = pubstate;
    }
    
}
